<?php
namespace Admin\Controller;
use Think\Controller;
class IndexController extends Controller {
    /**
	 * 24小时管理员登录页面
	 * @param string  
	 * @return   
	 */
	public function index(){
        //$this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>！</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
        //$this->show('admin index()');
        $this->display('login');
    }
	/**
	 * 显示首页
	 * @param string  
	 * @return   
	 */
	public function dispalyIndex(){
        $this->display('Index');
    }
	
	/**
	 * 管理员验证登录
	 * @param string 用户名post.name
	 * @param string 密码post.pwd
	 * @param string 验证码post.verifyCode	
	 * @param string 记住密码post.rememberMe	
	 * @return  json
	 */ 
	public function checkLogin(){
		if(IS_POST){
			$postData	= I('post.pwd');
			$username	= '张三';	
			$pwd		= '123456';
			$id			= '1';
			session('user.name',$username);  //设置session	
			session('user.id',$id);  //设置session	
			$data 		= array(
								'status'		=> 200,
								'info' 			=> 'ok',
								'test'			=> $postData,
								'callback' 		=> U('Index/dispalyIndex')
							);
			$this->ajaxReturn($data);
		}else{
			$data 		= array(
								'status'		=> 400,
								'info' 			=> 'Bad request!',
								'test'			=> $postData,
								'callback' 		=> U('Index/dispalyIndex')
							);
			$this->ajaxReturn($data);
		}
		
    }
	/**
	 *管理员注册
	 * @param string 用户名post.name
	 * @param string 用户密码post.pwd	 
	 * @param string 用户手机post.phone	 
	 * @param string 用户邮箱post.email	 
	 * @return  json
	 */ 
	public function register(){
		if(IS_POST){
			//用户密码sloat
			$sloat	= generateRandomString();
			$data 	= array(
							'status'		=> 200,
							'info' 			=> 'ok',
							'callback' 		=> U('Index/dispalyIndex')
						);
			$this->ajaxReturn($data);
		}else{
			$data 	= array(
							'status'		=> 400,
							'info' 			=> 'Bad request!',
							'callback' 		=> U('Index/dispalyIndex')
						);
			$this->ajaxReturn($data);
		}
		
    }
	/**
	 *管理员找回密码
	 * @param string 找回密码的账号post.reclam_pwd_name 
	 * @param string 找回密码的账号绑定的手机/邮箱post.reclam_pwd_phone
	 * @return  json
	 */ 
	public function forget_pwd(){
		if(IS_POST){
			$data = array(
				'status'		=> 200,
                'info' 			=> 'ok',
                'callback' 		=> U('Index/dispalyIndex')
            );
			$this->ajaxReturn($data);
		}else{
			$data = array(
				'status'		=> 400,
                'info' 			=> 'Bad request!',
                'callback' 		=> U('Index/dispalyIndex')
            );
			$this->ajaxReturn($data);
		}
        
    }
	public function transaction(){
        //$this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>！</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
        //$this->show('admin index()');
        $this->display('');
    }
	public function Order_Chart(){
        //$this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>！</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
        //$this->show('admin index()');
        $this->display('');
    }
	/**
	 *24小时快递-订单列表
	 * @param string 找回密码的账号post.reclam_pwd_name 
	 * @param string 找回密码的账号绑定的手机/邮箱post.reclam_pwd_phone
	 * @return  json
	 */
	public function Orderform(){
		
        $order					= D('order');	
		$map					= array();	
		$map['status']			= 1;	
		$map['is_del']			= 0;
		//每页显示数据条数
		$pageSize				= 2;
		// 获取admin列表总页数
		$count					= $order->where($map)->count();
		$page					= ceil($count/$pageSize);
		// 获取当前页数据
		$data					= $order->where($map)->limit(0,$pageSize)->select();
		$this->assign('page',$page);
		$this->assign('data',$data);
        $this->display('');
        //$this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>！</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
        //$this->show('admin index()');
        //$this->display('');
    } 
	/**
	*24小时订单列表	测试地址http://www.boss24delivery.com/index.php/admin/index/ajax_order_list  （postman post）
	*24小时订单列表	ajax分页数据返回
	*24小时订单列表	@param post.page 当前页码
	*24小时订单列表	@param post.pageSize 每页显示个数(可选)
	*24小时订单列表	@return return.data 该页显示的数据
	*24小时订单列表	@return return.msg 提示信息
	*24小时订单列表	@return return.status 状态 200表示成功
	**/
	public function ajax_order_list(){
		if(empty(session('user.name'))){
							$return 				= array(
															"msg"   	=> 'login first！',
															"status"	=> '400',
															'cotent'	=> '请先登录！',
															//'count'	=>'',
															"data"  	=>'post',
														);
							$this->ajaxReturn($return);
			
		}else{
				if(IS_POST){
					 
						$pageSize				= I('post.pageSize');
						$page					= I('post.page');
						$order					= D('order');	
						$map					= array();	
						$map['status']			= 1;	
						$map['is_del']			= 0;
						//每页显示数据条数
						if(empty($pageSize)){
							$pageSize				= 2;
							}
						//当前页码对应数据库起始数据  2  1  
						$start					= ($page-1)*$pageSize ;
						if($start<=0){
							$start	= 0;
						}
						//echo $start;
						//echo $pageSize;
						//var_dump($map); 
						// 获取当前页数据
						$data					= $order->limit($start,$pageSize)->select(); 
						$return 				= array(
														"msg"   	=> '查询成功！',
														"status"	=> '200',
														'cotent'	=> '',
														//'count'	=>'',
														"data"  	=>$data,
													);
						$this->ajaxReturn($return);
				}else{
						$return 				= array(
														"msg"   	=> 'Bad request！',
														"status"	=> '200',
														'cotent'	=> '',
														//'count'	=>'',
														"data"  	=>'post',
													);
						$this->ajaxReturn($return);
				}
		}
		
	}
	public function Amounts(){
        //$this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>！</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
        //$this->show('admin index()');
        $this->display('');
    }
	public function Order_handling(){
        //$this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>！</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
        //$this->show('admin index()');
        $this->display('');
    }
	public function Refund(){
        //$this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>！</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
        //$this->show('admin index()');
        $this->display('');
    }
	/**
	*24小时快递用户列表
	**/
	public function user_list(){
        $member					= D('member');	
		$map					= array();	
		$map['status']			= 1;	
		$map['is_del']			= 0;
		//每页显示数据条数
		$pageSize				= 5;
		// 获取admin列表总页数
		$count					= $member->where($map)->count();
		$page					= ceil($count/$pageSize);
		// 获取当前页数据
		$data					= $member->where($map)->limit(0,$pageSize)->select();
		$this->assign('page',$page);
		$this->assign('data',$data);
        $this->display('');
    }
	/**
	*24小时管理员列表
	**/
	public function admin_list(){
		$admin					= D('admin');	
		$map					= array();	
		$map['status']			= 1;	
		$map['is_del']			= 0;
		//每页显示数据条数
		$pageSize				= 5;
		// 获取admin列表总页数
		$count					= $admin->where($map)->count();
		$page					= ceil($count/$pageSize);
		// 获取当前页数据
		$data					= $admin->where($map)->limit(0,$pageSize)->select();
		$this->assign('page',$page);
		$this->assign('data',$data);
        $this->display('admin_list');
    }
	/**
	*24小时管理员列表	测试地址http://www.boss24delivery.com/index.php/admin/index/admin_list_data  （postman post）
	*24小时管理员列表	ajax分页数据返回
	*24小时管理员列表	@param post.page 当前页码
	*24小时管理员列表	@param post.pageSize 每页显示个数(可选)
	*24小时管理员列表	@return return.data 该页显示的数据
	*24小时管理员列表	@return return.msg 提示信息
	*24小时管理员列表	@return return.status 状态 200表示成功
	**/
	public function admin_list_data(){
		if(empty(session('user.name'))){
				$return 				= array(
										"msg"   	=> '请先登录再查询',
										"status"	=> '400',
										'code'		=> 'Bad request!',
										//'count'	=>'',
										//"data"  =>$data,
									);
				$this->ajaxReturn($return); 
			}else{
					if(IS_POST){ 
						$pageSize				= I('post.pageSize');
						$page					= I('post.page');
						$admin					= D('admin');	
						$map					= array();	
						$map['status']			= 1;	
						$map['is_del']			= 0;
						//每页显示数据条数
						if(empty($pageSize)){
							$pageSize				= 5;
							}
						//当前页码对应数据库起始数据  2  1  
						$start					= ($page-1)*$pageSize ;
						if($start<=0){$start	= 0;
						}
						//echo $start;
						//echo $pageSize;
						//var_dump($map); 
						// 获取当前页数据
						$data					= $admin->limit($start,$pageSize)->select(); 
						$return 				= array(
														"msg"   	=> '查询成功！',
														"status"	=> '200',
														'cotent'	=> '',
														//'count'	=>'',
														"data"  	=>$data,
													);
						$this->ajaxReturn($return);
					}else{
						$return 				= array(
													"msg"   	=> '查询失败！',
													"status"	=> '400',
													'code'		=> 'Bad request!',
													//'count'	=>'',
													//"data"  =>$data,
												);
						$this->ajaxReturn($return);
					}
			}
		
		
    }
	/**
	*24小时用户列表	测试地址http://www.boss24delivery.com/index.php/admin/index/member_list_data  （postman post）
	*24小时用户列表	ajax分页数据返回
	*24小时用户列表	@param post.page 当前页码
	*24小时用户列表	@param post.pageSize 每页显示个数(可选)
	*24小时用户列表	@return return.data 该页显示的数据
	*24小时用户列表	@return return.msg 提示信息
	*24小时用户列表	@return return.status 状态 200表示成功
	**/
	public function member_list_data(){
		if(empty(session('user.name'))){
				$return 				= array(
										"msg"   	=> '请先登录再查询',
										"status"	=> '400',
										'code'		=> 'Bad request!',
										//'count'	=>'',
										//"data"  =>$data,
									);
				$this->ajaxReturn($return); 
			}else{
					if(IS_POST){ 
						$pageSize				= I('post.pageSize');
						$page					= I('post.page');
						$member					= D('member');	
						$map					= array();	
						$map['status']			= 1;	
						$map['is_del']			= 0;
						//每页显示数据条数
						if(empty($pageSize)){
							$pageSize				= 5;
							}
						//当前页码对应数据库起始数据  2  1  
						$start					= ($page-1)*$pageSize ;
						if($start<=0){$start	= 0;
						}
						//echo $start;
						//echo $pageSize;
						//var_dump($map); 
						// 获取当前页数据
						$data					= $member->limit($start,$pageSize)->select(); 
						$return 				= array(
														"msg"   	=> '查询成功！',
														"status"	=> '200',
														'cotent'	=> '',
														//'count'	=>'',
														"data"  	=>$data,
													);
						$this->ajaxReturn($return);
					}else{
						$return 				= array(
													"msg"   	=> '查询失败！',
													"status"	=> '400',
													'code'		=> 'Bad request!',
													//'count'	=>'',
													//"data"  =>$data,
												);
						$this->ajaxReturn($return);
					}
			}
		
		
    }
	/**
	*24小时快递员列表
	**/
	public function delivery_list_number(){ 
		$delivery				= D('delivery');	
		$map					= array();	
		$map['status']			= 1;	
		$map['is_del']			= 0;
		//每页显示数据条数
		$pageSize				= 5;
		// 获取admin列表总页数
		$count					= $delivery->where($map)->count();
		$page					= ceil($count/$pageSize);
		// 获取当前页数据
		$data					= $delivery->where($map)->limit(0,$pageSize)->select();
		$this->assign('page',$page);
		$this->assign('data',$data); 
        $this->display('delivery_list_number');
    }
	/**
	*24小时快递员列表	测试地址http://www.boss24delivery.com/index.php/admin/index/delivery_list_data  （postman post）
	*24小时快递员列表	ajax分页数据返回
	*24小时快递员列表	@param post.page 当前页码
	*24小时快递员列表	@param post.pageSize 每页显示个数(可选)
	*24小时快递员列表	@return return.data 该页显示的数据
	*24小时快递员列表	@return return.msg 提示信息
	*24小时快递员列表	@return return.status 状态 200表示成功
	**/
	public function delivery_list_data(){
		if(empty(session('user.name'))){
				$return 				= array(
										"msg"   	=> '请先登录再查询',
										"status"	=> '400',
										'code'		=> 'Bad request!',
										//'count'	=>'',
										//"data"  =>$data,
									);
				$this->ajaxReturn($return); 
			}else{
					if(IS_POST){ 
						$pageSize				= I('post.pageSize');
						$page					= I('post.page');
						$delivery				= D('delivery');	
						$map					= array();	
						$map['status']			= 1;	
						$map['is_del']			= 0;
						//每页显示数据条数
						if(empty($pageSize)){
							$pageSize				= 5;
							}
						//当前页码对应数据库起始数据  2  1  
						$start					= ($page-1)*$pageSize ;
						if($start<=0){$start	= 0;
						}
						//echo $start;
						//echo $pageSize;
						//var_dump($map); 
						// 获取当前页数据
						$data					= $delivery->limit($start,$pageSize)->select(); 
						$return 				= array(
														"msg"   	=> '查询成功！',
														"status"	=> '200',
														'cotent'	=> '',
														//'count'	=>'',
														"data"  	=>$data,
													);
						$this->ajaxReturn($return);
					}else{
						$return 				= array(
													"msg"   	=> '查询失败！',
													"status"	=> '400',
													'code'		=> 'Bad request!',
													//'count'	=>'',
													//"data"  =>$data,
												);
						$this->ajaxReturn($return);
					}
			}
		
		
    }
	public function delivery_member_Grading(){
        //$this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>！</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
        //$this->show('admin index()');
        $this->display('delivery_member_Grading');
    }
	public function admin_Grading(){
		$this->display('');
	}
	public function member_Grading(){
		$this->display('member-grading');
	}
	public function delivery_integration(){
		$this->display('');
	}
	public function adminIntegration(){
		$this->display('admin_integration');
	}
	public function integration(){
		$this->display('');
	}
	public function Shop_list(){
		$this->display('');
	}
	public function Shops_Audit(){
		$this->display('');
	}
	public function Guestbook(){
		$this->display('');
	}
	/**
	*24小时意见反馈列表
	**/
	public function Feedback(){  
		$feedback				= D('user_feedback');	
		$map					= array();	
		$map['status']			= 1;	
		$map['is_del']			= 0;
		//每页显示数据条数
		$pageSize				= 5;
		// 获取admin列表总页数
		$count					= $feedback->where($map)->count();
		$page					= ceil($count/$pageSize);
		// 获取当前页数据
		$data					= $feedback->where($map)->limit(0,$pageSize)->select();
		$this->assign('page',$page);
		$this->assign('data',$data);
        $this->display(''); 
	}
	/**
	*24小时快递员列表	测试地址http://www.boss24delivery.com/index.php/admin/index/feedback_list_data  （postman post）
	*24小时快递员列表	ajax分页数据返回
	*24小时快递员列表	@param post.page 当前页码
	*24小时快递员列表	@param post.pageSize 每页显示个数(可选)
	*24小时快递员列表	@return return.data 该页显示的数据
	*24小时快递员列表	@return return.msg 提示信息
	*24小时快递员列表	@return return.status 状态 200表示成功
	**/
	public function feedback_list_data(){
		if(empty(session('user.name'))){
				$return 				= array(
										"msg"   	=> '请先登录再查询',
										"status"	=> '400',
										'code'		=> 'Bad request!',
										//'count'	=>'',
										//"data"  =>$data,
									);
				$this->ajaxReturn($return); 
			}else{
					if(IS_POST){ 
						$pageSize				= I('post.pageSize');
						$page					= I('post.page');
						$user_feedback			= D('user_feedback');	
						$map					= array();	
						$map['status']			= 1;	
						$map['is_del']			= 0;
						//每页显示数据条数
						if(empty($pageSize)){
							$pageSize				= 5;
							}
						//当前页码对应数据库起始数据  2  1  
						$start					= ($page-1)*$pageSize ;
						if($start<=0){$start	= 0;
						}
						//echo $start;
						//echo $pageSize;
						//var_dump($map); 
						// 获取当前页数据
						$data					= $user_feedback->limit($start,$pageSize)->select(); 
						$return 				= array(
														"msg"   	=> '查询成功！',
														"status"	=> '200',
														'cotent'	=> '',
														//'count'	=>'',
														"data"  	=>$data,
													);
						$this->ajaxReturn($return);
					}else{
						$return 				= array(
													"msg"   	=> '查询失败！',
													"status"	=> '400',
													'code'		=> 'Bad request!',
													//'count'	=>'',
													//"data"  =>$data,
												);
						$this->ajaxReturn($return);
					}
			}
		
		
    }
	public function article_list(){
		$this->display('');
	}
	public function article_Sort(){
		$this->display('');
	}
	public function Systems(){
		$this->display('');
	}
	public function System_section(){
		$this->display('');
	}
	public function System_Logs(){
		$this->display('');
	}
	public function admin_Competence(){
		$this->display('');
	}
	public function administrator(){
		$this->display('');
	}
	public function admin_info(){
		$this->display('');
	}
	public function picture_add(){
		$this->display('picture-add');
	}
	public function member_add(){
		$this->display('member-add');
	}
	public function Add_Brand(){
		$this->display('');
	}
	public function Brand_detailed(){
		$this->display('');
	}
	public function product_category_add(){
		$this->display('product-category-add');
	}
	public function Account_Details(){
		$this->display('');
	}
	public function member_show(){
		$this->display('member-show');
	}
	public function products_list(){
		$this->display('');
	}
	public function brand_manage(){
		$this->display('');
	}
	public function category_manage(){
		$this->display('');
	}
	public function cover_management(){
		$this->display('');
	}
	public function payment_configure(){
		$this->display('');
	}

}